package com.liangzhong.model.goods.vo
{
	import com.global.GlobalDef;
	import com.liangzhong.model.AppData;
	import com.liangzhong.model.type.GoodsType;
	import com.liangzhong.model.type.PlayerPlaceType;

	/**
	 *球员球星vo 
	 * @author lake
	 * 
	 */	
	public class PlayerStarVo extends GoodsVo
	{
		/**
		 * 球星id
		 */		
		public var starid 			:int;
		/**
		 *球员id 
		 */		
		public var playerid			:int;
		/**
		 * 是否自身球员：
		 * 1.	是
		 * 2.	不是
		 */
		public var self				:int;
		/**
		 *球星等级 
		 */		
		public var level			:int = 1;
		/**
		 *球星名字 
		 */		
		public var pname 			:String = "";
		/**
		 *体力 
		 */		
		public var physical			:int;
		/**
		 *所在洲ID：
			1.	Austrlia
			2.	Asia
			3.	NorthAmerica
			4.	Africa
			5.	Europe
			6.	SouthAmerica
		 */		
		public var land				:int;
		/**
		 *俱乐部名字 
		 */		
		public var clubname 		:String;
		/**
		 *球员位置：
			1.	GK
			2.	DF
			3.	MF
			4.	FW 
		 */		
		public var place			:int;
		/**
		 *进攻 
		 */		
		public var attack 			:int;
		/**
		 *进攻概率 
		 */		
		public var attprob 			:int;
		/**
		 * 防守
		 */		
		public var defence 			:int;
		/**
		 * 防守概率
		 */		
		public var defprob 			:int;
		/**
		 * 抢断
		 */		
		public var steal 			:int;
		/**
		 *抢断概率 
		 */		
		public var steprob 			:int;
		/**
		 * 力量
		 */		
		public var power 			:int;
		/**
		 * 力量概率
		 */		
		public var powprob 			:int;
		/**
		 * 速度
		 */		
		public var speed 			:int;
		/**
		 *速度概率 
		 */		
		public var speprob 			:int;
		/**
		 * 控球
		 */		
		public var control 			:int;
		/**
		 *控球概率 
		 */		
		public var conprob 			:int;
		/**
		 *专注 
		 */		
		public var concent 			:int;
		/**
		 *潜力 
		 */		
		public var potent 			:int;
		/**
		 *玩家等级 
		 */		
		public var clublevel 		:int;
		/**
		 *球探等级 
		 */		
		public var explorelevel 	:int;
		/**
		 *球场等级 
		 */		
		public var parklevel 		:int;
		/**
		 *酒吧等级 
		 */		
		public var barlevel 		:int;
		/**
		 *训练营等级 
		 */		
		public var trainlevel 		:int;
		/**
		 *青训营等级 
		 */		
		public var canteralevel 	:int;
		/**
		 *仓库等级 
		 */		
		public var knapsacklevel 	:int;
		/**
		 *冠军杯次数 
		 */		
		public var champions 		:int;
		/**
		 *传奇挑战次数 
		 */		
		public var legend 			:int;
		/**
		 *国家挑战冠军次数 
		 */		
		public var nation 			:int;
		/**
		 *天梯第一名次数 
		 */		
		public var ladder1 			:int;
		/**
		 * 天梯第二名次数
		 */		
		public var ladder2 			:int;
		/**
		 * 天梯第三名次数
		 */		
		public var ladder3 			:int;
		/**
		 *天梯前10次数 
		 */		
		public var ladder4 			:int;
		/**
		 *天梯前100次数 
		 */		
		public var ladder5 			:int;
		/**
		 *一场比赛进球多少个 
		 */		
		public var goals			:int;
		/**
		 *所在洲ID：
		 1.	Austrlia
		 2.	Asia
		 3.	NorthAmerica
		 4.	Africa
		 5.	Europe
		 6.	SouthAmerica
		 */			
		public var clubland 		:int;
		/**
		 *擅长位置 
		 */		
		public var adept 			:String;
		/**
		 *球员特点 
		 */		
		public var point 			:String;
		
		
		/**
		 *工资 
		 */
		public var salary:int;
		/**
		 *综合能力 
		 */
		public var ability:int;
		
		public function PlayerStarVo()
		{
			super();
		}
		/**
		 *解析数据 
		 * @param data
		 * 
		 */		
		override public function parse(data :Object):void
		{
			var xmlList:XMLList = data.children();
			for each(var xml:XML in xmlList)
			{
				if(this.hasOwnProperty(xml.localName()))
				{
					this[xml.localName()] = xml.toString();
				}
			}
			name 	= pname;
			if(header == null || header == "")
			{
				header = "default.png";
			}
			url  		= GlobalDef.Web_Res_Url + "star/" + header;
			bigheader 	= GlobalDef.Web_Res_Url + "star/" + bigheader;
			type 		= GoodsType.PLAYERCARD;
			pid 		= starid;
			gid			= starid;
		}
		/**
		 *获取位置字符描述 
		 * @return 
		 * 
		 */		
		public function get placeName():String
		{
			switch(place)
			{
				case PlayerPlaceType.DF:
				{
					return "DF";
				}
				case PlayerPlaceType.FW:
				{
					return "FW";
				}
				case PlayerPlaceType.GK:
				{
					return "GK";
				}
				case PlayerPlaceType.MF:
				{
					return "MF";
				}
			}
			return "";
		}
		/**
		 *获取tips 显示信息 
		 * @return 
		 * 
		 */		
		override public function get tipsInfo():String
		{
			var colors :Array = ["#999999","#00FF66","#0033CC","#660099","#FFFF33","#FF0000","#FFFF00"];
			var colorDesc :Array = ["山寨","廉价","普通","精致","昂贵","顶级","逆天"];
			var info :String = "<p align='left'><font color='"+ colors[color-1] +"'>" + name + "</font>\n\n";
			info +="<p align='left'><font color='#33ccff'>双击使用 在球员中心查看</font>"
			return info;
		}
		/**
		 *签约条件  
		 * @return 
		 * 
		 */
		public function get singCon():String
		{
			var str:String = "";
			if(coin > 0)
				str += ("欧元：" + coin + "\n");
			if(fame > 0)
				str += "声望：" + fame　+ "\n";
			if(cashpoint > 0)
				str += "点券：" + cashpoint + "\n";
			if(devote > 0)
				str += "贡献点："+ devote + "\n";
			if(rival > 0)
				str += "对抗点：" + rival  + "\n";
			if(honour > 0)
				str += "荣耀点：" + honour + "\n";
			if(unions > 0)
				str += "联赛点" + unions + "\n";
			if(clublevel > 0)
				str += "俱乐部等级：" + clublevel + "\n";
			if(explorelevel > 0)
				str += "球探等级：" +explorelevel + "\n";
			if(parklevel > 0)
				str += "球场等级：" + parklevel + "\n";
			if(barlevel > 0)
				str += "酒吧等级：" + barlevel + "\n";
			if(trainlevel > 0)
				str += "训练营等级：" + trainlevel + "\n";
			if(canteralevel > 0)
				str += "青训营等级：" + canteralevel + "\n";
			if(knapsacklevel > 0)
				str += "仓库等级:" + knapsacklevel + "\n";
			if(champions > 0)
				str += "获得冠军杯冠军：" + champions + "次  " +　AppData.getInstance().clubDatamanager.achieveDate.champions + "/" + champions +"\n";
			if(legend > 0)
				str += "赢取传奇挑战：" + legend + "次  "+　AppData.getInstance().clubDatamanager.achieveDate.league + "/" + legend+"\n";
			if(nation > 0)
				str += "国家挑战冠军次数：" + nation + "次  "+　AppData.getInstance().clubDatamanager.achieveDate.nation + "/" + nation+"\n";
//			if(king > 0)
//				str += "" + king;
			if(ladder1 > 0)
				str += "获得天梯冠军：" + ladder1 +"次  " +　AppData.getInstance().clubDatamanager.achieveDate.ladder1 + "/" + ladder1+"\n";
			if(ladder2 > 0)
				str += "获得天梯亚军：" + ladder2 +"次  " +　AppData.getInstance().clubDatamanager.achieveDate.ladder2 + "/" + ladder2+"\n";
			if(ladder3 > 0)
				str += "获得天梯第三名：" + ladder3 +"次  " +　AppData.getInstance().clubDatamanager.achieveDate.ladder3 + "/" + ladder3+"\n";
			if(ladder4 > 0)
				str += "获得天梯前10名：" + ladder4 +"次  " +　AppData.getInstance().clubDatamanager.achieveDate.ladder4 + "/" + ladder4+"\n";;
			if( ladder5 > 0)
				str += "获得天梯前100名：" + ladder5 +"次\n" ;
			if(goals > 0)
				str += "一场比赛进" + goals + "个球  "+　AppData.getInstance().clubDatamanager.achieveDate.goals + "/" + goals+"\n";
//			if(purple > 0)
//				str = "俱乐部所需紫色球员" + purple + "人\n";
//
//			if(orange > 0)
//				str = "俱乐部所需橙色球员" + orange + "人\n";
//			if(red > 0)
//				str = "俱乐部所需红色球员" + red + "人\n";
//			if(black > 0)
//				str = "俱乐部所需黑色球员" + black + "人\n";
//			trace(str);
			return str;
			
			
			
			
			
		}
	}
}